//
//  HomeWebViewController.m
//  Meng
//
//  Created by dllo on 15/9/30.
//  Copyright (c) 2015年 ljw. All rights reserved.
//

#import "HomeWebViewController.h"

@interface HomeWebViewController () <UIWebViewDelegate>
//在arc 下 字符串用copy 数组之类的用strong
@property (nonatomic, retain) UIWebView *webView;
@property (nonatomic, assign) NSInteger i;
@end

@implementation HomeWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor orangeColor];
    self.TitleLabel.text = @"详细攻略";
    [self webViewSubView];
    
}
- (void)webViewSubView
{
    self.webView = [[UIWebView alloc] initWithFrame:self.view.frame];
    [self.view addSubview:self.webView];
    [_webView release];
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.str]]];
    self.webView.delegate = self;
}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
    if (self.i <= 0) {
        return YES;
    }else
        return NO;
}


-(void)webViewDidFinishLoad:(UIWebView *)webView
{
    self.i++;
//    [self hideWaiting];
}

-(void)hideWaiting
{
   [[self.view viewWithTag:9998] removeFromSuperview];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
